import request from '@/utils/request'
import {http as $http} from "../utils/request";

export async function login(data) {
  console.log(data)
  let result = await $http.post('/login', data)
  let res = Object.assign(result, {code: 20000})
  return res
}

export function getInfo(token) {
  return {
    code: 20000,
    data: {
      roles: ['admin'],
      introduction: 'I am a super administrator',
      avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
      name: 'Super Admin'
    }
  }
}

export function logout() {
  return {
    code: 20000,
    data: 'success'
  }
}
